<template>
    <div>
        <h1>修改页面</h1>
        分类名称:<input type="text" v-model="name">
        <button @click="put_t">提交</button>
        <button @click='abc'>返回展示页面</button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                id:this.$route.query.id,
                name:""
            }
        },
        methods:{
            put_t(){
                this.$axios.put('cateM/?id='+this.id+'&name='+this.name).then(res=>{
                    if(res.data.code==200){
                        console.log(res.data)
                        alert('修改成功')
                    }
                })
            },
            abc(){
                // 返回上一级页面
                this.$router.go(-1)
            }
        },
        mounted(){}
    }
</script>

<style scoped>

</style>